<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        background-color: #333;
      }
    </style>
  </head>
  <body>
    <div class="ant">ant盒子</div>
    <button class="btn">删除按钮</button>

    <script>
      const boxEl = document.querySelector('.btn');
      const antEl = document.querySelector('.ant');

      boxEl.addEventListener('click', function () {
        console.log(this.innerHTML);
        // 重排(对节点的大小、位置进行重新修改)
        antEl.remove();
        this.style.height = '200px';
      });
    </script>
  </body>
</html>
